JavaScript Mobile Application Development by Hazem Saleh

JavaScript Mobile Application Development by Hazem Saleh
Author: Hazem Saleh [Saleh, Hazem]
Language: eng
Format: epub, mobi, azw3, pdf
Publisher: Packt Publishing
Published: 2014-10-20

As you can see in the preceding highlighted code, FileManager is a singleton object that has two methods. In order to work with directories or files using Apache Cordova, we first need to request a filesystem using the requestFileSystem() method as window.requestFileSystem(type, size, successCallback, errorCallback).

The window.requestFileSystem method has the following parameters in order:

type: This refers to the local filesystem type

Size: This indicates how much storage space, in bytes, the application expects to need

successCallback: This will be called if the operation succeeds, and it will receive a FileSystem object as a parameter

errorCallback: This will be called if an operation error occurs